const { DataTypes } = require('sequelize');
const sequelize = require('../db/seq')

const User = sequelize.define('User', {
    // 在这里定义模型属性
    userName: {
        type: DataTypes.STRING,
        allowNull: false,
        unicode: true,
        comment: '用户名，唯一'
    },
    passWord: {
        type: DataTypes.CHAR(64),
        allowNull: false,
        comment: '密码'
    },
    isAdmin: {
        type: DataTypes.BOOLEAN,
        allowNull: false,
        defaultValue: 0,
        comment: '管理员1，普通成员0'
    }
});
// User.sync({ force: true })
module.exports = User